package com.service.question.resources;

import com.huawei.questionnaire.resources.api.SatisfactionApi;
import com.huawei.questionnaire.resources.dto.SaveInfoResp;
import com.huawei.questionnaire.resources.dto.SaveSatisfaction;
import com.service.question.application.api.IQuestionnaireApi;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RestController;


/**
 * @author ：hjl
 * @date ：Created in 2022/03/10 17:24
 * @description：
 */
@RestController
public class SatisfactionSurveyController implements SatisfactionApi {
    Logger logger = LoggerFactory.getLogger(SatisfactionApi.class);

    @Autowired
    private IQuestionnaireApi questionnaireApi;

    @Override
    public ResponseEntity<SaveInfoResp> receiveSatisfaction(SaveSatisfaction saveSatisfaction)
    {
        logger.info("receive satisfaction start");
        return ResponseEntity.ok(questionnaireApi.saveSatisfactionResult(saveSatisfaction));
    }
}
